<div class="title">Sửa Sinh Viên Phòng</div>
<?php
	include('connectDB.php');
	$sql1="select * from hanthuephong";
	$r1=mysql_query($sql1);
	$nr1=mysql_fetch_assoc($r1);
	$ngayhh=$nr1['ngayhethan'];
	$masv=$_GET['p_ID'];
	$sql="select * from sinhvien_phong where masv='$masv'";
	$r=mysql_query($sql);
	$nr=mysql_fetch_array($r);
?>
<div class="frm">
	
	<table>
    <form action="sinhvien_phong/edit_sv_phong_action.php" name="frm" method="post">
    	<tr><td>Mã Sinh Viên:</td>
        <td><input type="text" name="txt_masv" value="<?php echo $nr['masv'];?>" readonly="readonly" /></td></tr>
        <tr><td>Mã Phòng:</td><td><input type="text" name="txt_map"  value="<?php echo $nr['maphong'];?>"/></td></tr>
        <tr><td>Ngày Hết Hạn:</td>
        <td><input type="date" name="dt_ngayhethan" value="<?php echo $ngayhh;?>"  /></td></tr>
        <tr><td colspan="2" align="center"><input type="submit" value="update" name="ok"  ondblclick="return check()"/></td></tr>
     </form> 
    </table>
</div>
 <a href="./?mod=svphong&do=ds_svphong" style="margin-top:30px; font-size:16px;s">Quay Lại</a>
<script language="javascript">

   		function check()
		{
			var mss="Thiếu thông tin, vui lòng kiểm tra lại!";
			reg = /[^0-9]/;	
			if(window.document.frm.txt_masv.value=="")
			{
				alert(mss);window.document.frm.txt_masv.focus();return false;
			}else if(reg.test(document.frm.txt_masv.value) ==true)
			{
				alert("Mã sinh viên phải là số");window.document.frm.txt_masv.focus();return false;
			}else if(window.document.frm.txt_map.value=="")
			{
				alert(mss);window.document.frm.txt_map.focus();return false;
			}
		}
</script>